home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / usr / lib / python2.6 / lib2to3 / fixes / fix_long.py < prev    next >
Encoding:
Python Source  |  2009-04-18  |  538 b   |  23 lines

  1. # Copyright 2006 Google, Inc. All Rights Reserved.
  2. # Licensed to PSF under a Contributor Agreement.
  3.  
  4. """Fixer that turns 'long' into 'int' everywhere.
  5. """
  6.  
  7. # Local imports
  8. from .. import fixer_base
  9. from ..fixer_util import Name, Number, is_probably_builtin
  10.  
  11.  
  12. class FixLong(fixer_base.BaseFix):
  13.  
  14.     PATTERN = "'long'"
  15.  
  16.     static_int = Name("int")
  17.  
  18.     def transform(self, node, results):
  19.         if is_probably_builtin(node):
  20.             new = self.static_int.clone()
  21.             new.set_prefix(node.get_prefix())
  22.             return new
  23.